package com.henu.art.service.Imlp;

import com.henu.art.util.JWTUtil;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: zoey
 * \\_/__/
 * @Date: 2025/05/13/19:34
 * @Description:
 */
@Service
public class UserOnlineServiceImpl {
    @Cacheable(value = "sys_env", key = "#username")
    public String setLoginStatus(String username) {
        return JWTUtil.sign(username);
    }

    @Cacheable(value = "sys_env", key = "#username", unless = "#result == null")
    public String getLoginStatus(String username) {
        return null;
    }

    @CacheEvict(value = "sys_env", key = "#username")
    public void setLogoutStatus(String username) {
        return;
    }

}
